import { observable, computed, action } from 'mobx';
import ApiHelper from './ApiHelper';
import BrokerListMini from './BrokerListMini';
import { store_list_mini } from '../constants/ApiTypes';
import adminType from '@/tool/adminType';

class StoreListMini {
    
    @observable info = [];
    @action async getInfo() {
        BrokerListMini.info.clear();
        if (adminType() != 1) {
            return await BrokerListMini.getInfo();
        }
        const result = await ApiHelper.requestPost(store_list_mini);
        if (result.status) {
            this.info.clear();
            this.info = result.info;
            return true;
        } else {
            this.info = [];
            return false;
        }
    }
}

export default new StoreListMini;